﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SurveillancePro.Base.Manager
{
    /// <summary>
    /// 刷新设备树代理
    /// </summary>
    public delegate void RefreshTreeHandler();

    /// <summary>
    /// 事件管理类
    /// </summary>
    public static class EventManagers
    {
        /// <summary>
        /// 刷新设备树事件
        /// </summary>
        public static event RefreshTreeHandler RefreshTreeEvent;

        /// <summary>
        /// 设备登录与注销时，刷新设备树事件
        /// </summary>
        public static event RefreshTreeHandler RefreshTreeWithLoginEvent;



        /// <summary>
        /// 刷新设备树
        /// </summary>
        public static void RefreshTree()
        {
            if (RefreshTreeEvent != null)
            {
                RefreshTreeEvent();
            }
        }


        /// <summary>
        /// 设备登录与注销时，刷新设备树
        /// </summary>
        public static void RefreshTreeWithLogin()
        {
            if (RefreshTreeWithLoginEvent != null)
            {
                RefreshTreeWithLoginEvent();
            }
        }
    }
}
